//
//  ijRDamJLCFMineInterestCelloYEtNj.m
//  qcb_ios
//
//  Created by Ji on 2018/9/3.
//  Copyright © 2018年 ski. All rights reserved.
//

#import "ijRDamJLCFMineInterestCelloYEtNj.h"

@interface ijRDamJLCFMineInterestCelloYEtNj ()

@property (nonatomic, strong) UIView *bgView;

@property (nonatomic, strong) UILabel *TvtacpmoneyLabelIfJqAd;

@property (nonatomic, strong) UILabel *mZnhRCmoneyLimitLabeltOhYMy;

@property (nonatomic, strong) UILabel *IRLkSrtimeLimitLabelPHxaMn;

@property (nonatomic, strong) UILabel *SHSlbVinterestLimitLabelHraCHC;

@property (nonatomic, strong) UILabel *giYBLKtypeLabelcaoSry;

@property (nonatomic, strong) UIImageView *vzcsvgstatusImgBoOiic;

@end

@implementation ijRDamJLCFMineInterestCelloYEtNj

- (void)reloadData
{
    
    if (self.welfare) {
        
        if (!self.bgView) {
            self.bgView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, FULL_WIDTH - 20, 120)];
            self.bgView.backgroundColor = QTZ_White;
            self.bgView.layer.cornerRadius = 5;
            [self addSubview:self.bgView];
        }
        
        if (!self.TvtacpmoneyLabelIfJqAd) {
            self.TvtacpmoneyLabelIfJqAd = [UILabel new];
            self.TvtacpmoneyLabelIfJqAd.textColor = Theme_Color;
            self.TvtacpmoneyLabelIfJqAd.font = FONT(15);
            [self.bgView addSubview:self.TvtacpmoneyLabelIfJqAd];
        }
        
        if (self.TvtacpmoneyLabelIfJqAd) {
            NSMutableAttributedString *attributeStr = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@%%", self.welfare.hbmoney]];
            [attributeStr addAttribute:NSFontAttributeName value:FONT(30) range:NSMakeRange(0, self.welfare.hbmoney.length)];
            self.TvtacpmoneyLabelIfJqAd.attributedText = attributeStr;
            [self.TvtacpmoneyLabelIfJqAd sizeToFit];
            self.TvtacpmoneyLabelIfJqAd.left = 42;
            self.TvtacpmoneyLabelIfJqAd.top = 34;
        }
        
        if (!self.mZnhRCmoneyLimitLabeltOhYMy) {
            self.mZnhRCmoneyLimitLabeltOhYMy = [UILabel new];
            self.mZnhRCmoneyLimitLabeltOhYMy.textColor = Theme_Color;
            self.mZnhRCmoneyLimitLabeltOhYMy.font = FONT(12);
            [self.bgView addSubview:self.mZnhRCmoneyLimitLabeltOhYMy];
        }
        
        if (self.mZnhRCmoneyLimitLabeltOhYMy) {
            self.mZnhRCmoneyLimitLabeltOhYMy.text = [NSString stringWithFormat:@"满%@元可用", self.welfare.smoney];
            [self.mZnhRCmoneyLimitLabeltOhYMy sizeToFit];
            self.mZnhRCmoneyLimitLabeltOhYMy.left = self.TvtacpmoneyLabelIfJqAd.left;
            self.mZnhRCmoneyLimitLabeltOhYMy.top = self.TvtacpmoneyLabelIfJqAd.bottom;
        }
        
        if (!self.IRLkSrtimeLimitLabelPHxaMn) {
            self.IRLkSrtimeLimitLabelPHxaMn = [UILabel new];
            self.IRLkSrtimeLimitLabelPHxaMn.textColor = QTZ_Gray102;
            self.IRLkSrtimeLimitLabelPHxaMn.font = FONT(11);
            [self.bgView addSubview:self.IRLkSrtimeLimitLabelPHxaMn];
        }
        
        if (self.IRLkSrtimeLimitLabelPHxaMn) {
            self.IRLkSrtimeLimitLabelPHxaMn.text = [NSString stringWithFormat:@"截止日期：%@", [self.welfare.hbendtime substringToIndex:10]];
            [self.IRLkSrtimeLimitLabelPHxaMn sizeToFit];
            self.IRLkSrtimeLimitLabelPHxaMn.left = 200;
            self.IRLkSrtimeLimitLabelPHxaMn.top = 20;
        }
        
        if (!self.SHSlbVinterestLimitLabelHraCHC) {
            self.SHSlbVinterestLimitLabelHraCHC = [UILabel new];
            self.SHSlbVinterestLimitLabelHraCHC.textColor = QTZ_Gray102;
            self.SHSlbVinterestLimitLabelHraCHC.font = FONT(11);
            [self.bgView addSubview:self.SHSlbVinterestLimitLabelHraCHC];
        }
        
        if (self.SHSlbVinterestLimitLabelHraCHC) {
            self.SHSlbVinterestLimitLabelHraCHC.text = [NSString stringWithFormat:@"标的周期：%@天", self.welfare.sday];
            [self.SHSlbVinterestLimitLabelHraCHC sizeToFit];
            self.SHSlbVinterestLimitLabelHraCHC.left = 200;
            self.SHSlbVinterestLimitLabelHraCHC.centerY = 60;
        }
        
        if (!self.giYBLKtypeLabelcaoSry) {
            self.giYBLKtypeLabelcaoSry = [UILabel labelWithText:@"标的类型：通用" textColor:QTZ_Gray102 font:FONT(11)];
            self.giYBLKtypeLabelcaoSry.left = 200;
            self.giYBLKtypeLabelcaoSry.bottom = 100;
            [self.bgView addSubview:self.giYBLKtypeLabelcaoSry];
        }
        
        if (!self.vzcsvgstatusImgBoOiic) {
            self.vzcsvgstatusImgBoOiic = [UIImageView new];
            [self.bgView addSubview:self.vzcsvgstatusImgBoOiic];
        }
        
        if (self.vzcsvgstatusImgBoOiic) {
            if ([self.welfare.hbstatus isEqualToString:@"2"]) {
                self.vzcsvgstatusImgBoOiic.image = [UIImage imageNamed:@"icon_welfare_late"];
            } else if ([self.welfare.hbstatus isEqualToString:@"3"]) {
                self.vzcsvgstatusImgBoOiic.image = [UIImage imageNamed:@"icon_welfare_userd"];
            } else {
                self.vzcsvgstatusImgBoOiic.image = nil;
            }
            [self.vzcsvgstatusImgBoOiic sizeToFit];
            self.vzcsvgstatusImgBoOiic.right = self.bgView.width - 7;
            self.vzcsvgstatusImgBoOiic.bottom = self.bgView.height - 6;
        }
        
        if ([self.welfare.hbstatus isEqualToString:@"0"]) {//keyoing
            self.TvtacpmoneyLabelIfJqAd.textColor = QTZ_Gray102;
            self.mZnhRCmoneyLimitLabeltOhYMy.textColor = QTZ_Gray102;
        } else {
            self.TvtacpmoneyLabelIfJqAd.textColor = Theme_Color;
            self.mZnhRCmoneyLimitLabeltOhYMy.textColor = Theme_Color;
        }
        
        
    }
    
}

@end
